package com.glsc.ngateway.platform.domain.softLegal;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * SoftLegalSerialNumber 实体类
 */
@Entity
@Data
@Table(name = "t_soft_legal_serical_number")
public class SoftLegalSerialNumber {

    /**
     * 软件 ID，主键，自增
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 软件名称
     */
    @Column(name = "software_name")
    private String softwareName;

    /**
     * 授权和许可情况
     */
    @Column(name = "authorization_and_license")
    private String authorizationAndLicense;

    /**
     * 软件序列号
     */
    @Column(name = "software_serial_number")
    private String softwareSerialNumber;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @ApiModelProperty(value = "更新时间")
    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

    @Column(name = "is_delete", nullable = true, columnDefinition = "int DEFAULT '0' COMMENT '是否删除，0未删除，1 已删除'")
    private Integer isDelete;
}

